<?php
class tag{
	public $tag = array(
       "abc"=>array('block'=>0),//指定标签为独立标签
     );
	function _abc($attr,$content,$hd){
		return "<script type='text/javascript' src='".__HDPHP__."/plugin/jquery-1.8.2.min.js'></script>";	
		}
	function _arclist($attr,$content){
		$row = isset($attr['row'])?$attr['row']:10;
		$type = isset($attr['type'])?$attr['type']:"new";
		switch ($type) {
			case "hot":
				$order= "answernumber desc";
				break;
			default:
				$order = "time desc";
				break;
			}
			$str='';
			$str.='<?php $db = M("xuser");'."\n";
			$str.='$rows = $db->order("'.$order.'")->limit('.$row.')->all();'."\n";
			$str.='foreach($rows as $abc):?>'."\n";
			$str.=$content;
			$str.='<?php endforeach;?>'."\n";
			return $str;
		}


		function _question($attr,$content){
		$row = isset($attr['row'])?$attr['row']:10;
		$type = isset($attr['type'])?$attr['type']:"new";
		switch ($type) {
			case "hot":
				$order= "answernumber desc";
				break;
			default:
				$order = "qtime desc";
				break;
			}
			$str='';
			$str.='<?php $db = M("xquestion");'."\n";
			$str.='$rows = $db->order("'.$order.'")->limit('.$row.')->all();'."\n";
			$str.='foreach($rows as $con):?>'."\n";
			$str.=$content;
			$str.='<?php endforeach;?>'."\n";
			return $str;
		}
		function _like($attr,$content){
		$row = isset($attr['row'])?$attr['row']:10;
		$type = isset($attr['type'])?$attr['type']:"new";
		switch ($type) {
			case "hot":
				$order= "answernumber desc";
				break;
			default:
				$order = "qtime desc";
				break;
			}
			$str='';
			$str.='<?php $db = M("xquestion");'."\n";
			$str.='$rows = $db->order("'.$order.'")->limit('.$row.')->all();'."\n";
			$str.='foreach($rows as $con):?>'."\n";
			$str.=$content;
			$str.='<?php endforeach;?>'."\n";
			return $str;
		}

		function _jqueryUi(){

		}
	}

?>